<link rel="stylesheet" type="text/css" href="assets/bootstrap-datepicker/css/datepicker.css" />
<form>
<aside class="lg-side">
  <div class="panel-heading tab-bg-dark-navy-blue okr-tab-head tab-right "></div>
  <div class="inbox-body mi-h8">
    <div class="row">
      <div class="col-lg-12">
        <section class="panel">
          <header class="panel-heading add-heading">
            会议纪要信息
          </header>
          <div class="panel-body">
            <div class="form-group customerForm">
              <label class="col-sm-2 control-label">会议开始日期</label>
              <div class="col-sm-10">
                <input id="time" type="text" value="" name="metTime" class="form-control" onkeyup="this.value=this.value.replace(/(^\s+)|(\s+$)/g,'');">
              </div>
            </div>
            <div class="form-group customerForm">
              <label class="col-sm-2 control-label">会议时间段</label>
              <div class="col-sm-10">
                <input type="text" value="" id="setime" name="setime" placeholder="例如:9:30-11:00" class="form-control" onkeyup="this.value=this.value.replace(/(^\s+)|(\s+$)/g,'');">
              </div>
            </div>
            <div class="form-group customerForm">
              <label class="col-sm-2 control-label">会议主题</label>
              <div class="col-sm-10">
                <textarea class="form-control" id="title" name="title" onkeyup="this.value=this.value.replace(/(^\s+)|(\s+$)/g,'');"  maxlength="50"
                placeholder="字数限制(50字以内)"></textarea>
              </div>
            </div>
            <div class="form-group customerForm">
              <label class="col-sm-2 control-label">会议纪要</label>
              <div class="col-sm-10">
                <textarea class="form-control" id="content" name="content" onkeyup="this.value=this.value.replace(/(^\s+)|(\s+$)/g,'');" maxlength="120"
                placeholder="字数限制(120字以内)"></textarea>
              </div>
            </div>
            <div class="form-group customerForm">
              <label class="col-sm-2 control-label">参会人员</label>
              <div class="col-sm-10">
                <textarea class="form-control" id="partakeUser" name="partakeUser" placeholder="例如:张三、李四" maxlength="120" onkeyup="this.value=this.value.replace(/(^\s+)|(\s+$)/g,'');"></textarea>
              </div>
            </div>
          </div>
        </section>
        <p class="default-buttons">
          <a href="javascript:void(0);" class="button-back btn btn-info" onclick="toBack()">返回</a>
          <a href="javascript:void(0);" class="button-next  btn btn-info submit">提交</a>
        </p>
      </div>
    </div>
  </div>
</aside>
</form>
<script type="text/javascript" src="assets/bootstrap-datepicker/js/bootstrap-datepicker.js"></script>
<script>
    //时间控件
    $('#time').datepicker({
        format: 'yyyy-mm-dd'
    });
    function toBack() {
        toLoadHtml(49);
    };
    var nid = 0;
    function toEditMeeting(id) {
        nid = id;
        $certusUtils.ajax('toEditMeeting',{"id":id,"projId":proId},function (response) {
            var data =response.data;
            var timeArr = data.metTime.split(" ");
            $("#time").val(timeArr[0]);
            $("#setime").val(timeArr[1]);
            $("#title").val(data.title);
            $("#content").val(data.content);
            $("#partakeUser").val(data.partakeUser);
        })
    }

    $(".submit").on('click',function () {
        var arr =$("form").serializeArray();
        var data = {};
        for (var i=0;i<arr.length;i++){
            data[arr[i].name] = arr[i].value;
        };
        data.id = nid;
        $certusUtils.ajax("editMeeting",{"params":JSON.stringify(data),"projId":proId},function(response){
            layer.msg("提交成功");
            toLoadHtml(49);
        });
    })
</script>